home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d13
/
qptech.arc
/
TI532.ASC
< prev
next >
Wrap
Text File
|
1991-04-25
|
11KB
|
463 lines
PRODUCT : QUATTRO PRO NUMBER : 532
VERSION : ALL
OS : PC DOS
DATE : April 18, 1991 PAGE : 1/6
TITLE : DELMAKER: DELIMITED OUTPUT MACRO
DELMAKER is a macro that lets you create a delimited format file
from a range of cells in the current spreadsheet. The delimited
formats can be Comma & Quote, Comma Only, or x delimited (where x
is any label you specify).
How to enter the DELMAKER macro:
Before typing the commands listed below, place the following
block names in column A, next to the cell addresses listed.
Block names needed by DELMAKER:
WIDTH B1
HEIGHT B2
ANSWER B3
BLOCKASK B5..B7
DELIMITER B8
WARNABORT B9..B11
COUNTER1 B13
COUNTER2 B14
FILENAME B15
CURRENTNUM B16
CURRENTWIND B17
QUOTES? B18
NUM_TYPE? B19
USE_QUOTES? B20
BLANKS_AS? B21
CELL_TYPE B22
DO_IT B24
WIDTHLOOP B27
HEIGHTLOOP B29
DONE B31
WRITETOFILE B37
DOROW B42
WRITECELL B44
WRITENUMBER B53
SAVEAS B60
VALUETYPE B65
\D B70
BLANKTYPE B75
TYPECELL B80
PRODUCT : QUATTRO PRO NUMBER : 532
VERSION : ALL
OS : PC DOS
DATE : April 18, 1991 PAGE : 2/6
TITLE : DELMAKER: DELIMITED OUTPUT MACRO
Note that some block names point to more than one cell.
These block names must be created using </> <Edit>
<Names> <Create>.
After you have entered all block name in column A, choose
</> <Edit> <Names> <Labels> <Right>, type A1..A80 and press
<ENTER>. This creates all of the block names the macro
needs. Some of the macro commands will return ERR after you
enter them. This is okay, since some formulas won't
evaluate properly until you run the macro.
After you enter the block names, enter the macro commands
listed at the end of this document into a spreadsheet in the
cell addresses indicated. Some macro commands will wrap to
the next line, which is okay. Enter the entire command into
one cell.
After you enter the macro, the spreadsheet must be
designated as a macro library file (</> <Tools> <Macro>
<Library> <Yes>), and saved with the file extension of .WQ1
(for example, DELMAKER.WQ1).
The DELMAKER macro:
B1: 2
B2: 3
B3: 'Y
B5: ^Enter
B6: ^Your
B7: ^Range
B8: ',
B9: ^Invalid
B10: ^File
B11: ^(press ENTER)
B16: ' 3
B17: +"["&@CURVALUE("File","Save")&"]_HERBERT"
B18: '"
B19: 'Numbers
B20: (CELL_TYPE = "Value"#AND#NUM_TYPE? = "Labels")#OR#(CELL_TYPE =
"Label")#OR#(CELL_TYPE = "Blank"#AND#BLANKS_AS? = "Empty Labels")
B21: 'Empty Labels
B22: 'Label
PRODUCT : QUATTRO PRO NUMBER : 532
VERSION : ALL
OS : PC DOS
DATE : April 18, 1991 PAGE : 3/6
TITLE : DELMAKER: DELIMITED OUTPUT MACRO
B24: '{/ Name;Create}_HERBERT~
B25: '{MESSAGE BLOCKASK,100,100,0}{?}~
B26: '{LET WIDTH,0}{LET HEIGHT,0}
B27: '{IF @ISERR(@CELLINDEX("type",[]_HERBERT,WIDTH+1,0))}{LET
WIDTH,WIDTH+1}{BRANCH HEIGHTLOOP}
B28: '{LET WIDTH,WIDTH+1}{BRANCH WIDTHLOOP}
B29: '{IF @ISERR(@CELLINDEX("type",[]_HERBERT,0,HEIGHT+1}{LET
HEIGHT,HEIGHT+1}{BRANCH DONE}
B30: '{LET HEIGHT,HEIGHT+1}{BRANCH HEIGHTLOOP}
B31: '{GETLABEL "Enter the filename to print to: ",FILENAME}
B32: '{LET ANSWER,"Y"}
B33: '{IF @FILEEXISTS(FILENAME)}{GETLABEL "Overwrite Old File? (Y/N):
",ANSWER}
B34: '{IF @LEFT(@UPPER(ANSWER),1)="Y"}{BRANCH WriteToFile}
B35: '{CLOSE FILENAME}{BRANCH DONE}
B37: '{OPEN FILENAME,W}{BEEP 2}{MESSAGE WARNABORT,0,0,0}{BRANCH DONE}
B38: '{FOR COUNTER1,0,HEIGHT-1,1,DoRow}
B39: '{CLOSE FILENAME}
B40: '{MENUBRANCH SaveAs}
B42: '{FOR counter2,0,WIDTH-1,1,WriteCell}
B44: '{TypeCell}{IF USE_QUOTES?}{WRITE QUOTES?}
B45: '{IF CELL_TYPE="Label"}{WRITE
@CELLINDEX("contents",[]_HERBERT,counter2,counter1)}
B46: '{IF BLANKS_AS?="Zeros" #AND# CELL_TYPE="Blank"}{WRITE "0"}
B47: '{IF CELL_TYPE="Value"}{CALC}{WriteNumber}
B48: '{IF USE_QUOTES?}{WRITE QUOTES?}
B49: '{IF counter2=WIDTH-1}{WRITELN ""}{BEEP 1}
B50: '{IF counter2<WIDTH-1}{WRITE DELIMITER}
B52: '{IF NUM_TYPE?="Labels"}{WriteAsLabel}{return}
B53: +"{CONTENTS CURRENTNUM,"&@CELLINDEX("address",@@(CURRENTWIND),$COUNTER2,$COUNTER1)
&","&@STRING(@CELLINDEX("width",@@(CURRENTWIND),$COUNTER2,$COUNTER1),0)&",113}"
B54: '{WRITE @trim(CURRENTNUM)}
B56: '{WRITE QUOTES?}
B57: +"{CONTENTS CURRENTNUM,"&@CELLINDEX("address",@@(CURRENTWIND),$COUNTER2,$COUNTER1)&"}"
B58: '{WRITE @trim(CURRENTNUM)}
B59: '{WRITE QUOTES?}
B60: 'Comma & "" Delimited File
B61: 'Save a block of data in a Comma & "" delimited format
B62: '{LET QUOTES?,""""}
B63: '{LET DELIMITER,","}{BRANCH DO_IT}
B65: 'Numbers
B66: 'Write the values as numbers in General Format
B67: '{LET NUM_TYPE?,"Numbers"}
PRODUCT : QUATTRO PRO NUMBER : 532
VERSION : ALL
OS : PC DOS
DATE : April 18, 1991 PAGE : 4/6
TITLE : DELMAKER: DELIMITED OUTPUT MACRO
B68: '{CALC}{MENUBRANCH SaveAs}
B70: '{LET QUOTES?,""""}{LET CELL_TYPE,""}{LET DELIMITER,","}
B71: '{LET NUM_TYPE?,"Numbers"}
B72: '{LET BLANKS_AS?,"Empty Labels"}
B73: '{/ Name;Create}_HERBERT~a1..a1~{MENUBRANCH SaveAs}
B75: 'Empty Labels
B76: 'Write the values as numbers in General Format
B77: '{LET BLANKS_AS?,"Empty Labels"}
B78: '{CALC}{MENUBRANCH SaveAs}
B80: '{IF @CELLINDEX("type",[]_HERBERT,counter2,counter1)="v"}{LET
CELL_TYPE,"Value"}
B81: '{IF @CELLINDEX("type",[]_HERBERT,counter2,counter1)="b"}{LET
CELL_TYPE,"Blank"}
B82: '{IF @CELLINDEX("type",[]_HERBERT,counter2,counter1)="l"}{LET
CELL_TYPE,"Label"}
B83: '{CALC}
C60: 'Specified Delimiter Format
C61: 'Save a file with Delimiters (No Quotes) in a format you choose.
C62: '{LET QUOTES?,""}{GETLABEL "Enter the Delimiter to use: ",DELIMITER}
C63: '{BRANCH DO_IT}
C65: 'Labels
C66: 'Write the values as labels with Formatting intact (Dates,etc.)
C67: '{LET NUM_TYPE?,"Labels"}
C68: '{CALC}{MENUBRANCH SaveAs}
C75: 'Zeros
C76: 'Write the values as labels with Formatting intact (Dates,etc.)
C77: '{LET BLANKS_AS?,"Zeros"}
C78: '{CALC}{MENUBRANCH SaveAs}
D60: 'Only Commas
D61: 'Save a block of data in a Comma Delimited Format
D62: '{LET QUOTES?,""}
D63: '{LET DELIMITER,","}{BRANCH DO_IT}
D65: 'Cancel
D66: 'Back out of this option
D67: '{MENUBRANCH SaveAs}
D75: 'Cancel
D76: 'Back out of this option
D77: '{MENUBRANCH SaveAs}
E60: +"Values Are Written As "&NUM_TYPE?
E61: 'Determine the method of storing values
E62: '{MENUBRANCH ValueType}
F60: +"Empty Cells Are Written As "&BLANKS_AS?
F61: 'Determine the method of storing empty cells
PRODUCT : QUATTRO PRO NUMBER : 532
VERSION : ALL
OS : PC DOS
DATE : April 18, 1991 PAGE : 5/6
TITLE : DELMAKER: DELIMITED OUTPUT MACRO
F62: '{MENUBRANCH BlankType}
G60: 'Quit
G61: 'Exit the macro
G62: '{/ Name;Delete}_HERBERT~
G63: '{QUIT}
How to use DELMAKER:
1. Verify that the macro library file containing the DELMAKER
macro is open.
2. Open the file from which you wish to extract data. Make
sure it is the current active window.
3. Press: Alt-D
4. The DELMAKER menu appears. Set your options (see the
descriptions below).
5. Select an output format (see the descriptions below).
6. DELMAKER prompts you to enter a range. Press a key to
continue, then highlight the block you want to extract.
7. DELMAKER prompts you to enter the name of the file to
store the extracted data. It will warn you if you are
going to overwrite an existing file. If the file already
exists, you can overwrite it or enter a different file
name.
8. When the DELMAKER menu returns, select Quit to exit the
macro or select an output format to output additional
information.
PRODUCT : QUATTRO PRO NUMBER : 532
VERSION : ALL
OS : PC DOS
DATE : April 18, 1991 PAGE : 6/6
TITLE : DELMAKER: DELIMITED OUTPUT MACRO
The DELMAKER menu:
The DELMAKER menu provides you with the following choices:
╔══════════════════════════════════════════════════╗
║ Comma and "" Delimited Format ║
║ Specified Delimiter Format ║
║ Only Commas ║
║ Values Are Written As Numbers ║
║ Empty Cells Are Written As Empty Labels ║
║ Quit ║
╚══════════════════════════════════════════════════╝
The first three options prompt you to highlight a range in the
current spreadsheet and enter the name of a file to store the
extracted data (Specified Delimiter Format also asks you for a
delimiter). By default, DELMAKER writes the file to the current
directory. To write to a file in another directory, enter the
full path name.
Comma & "" Delimited Format saves the file with commas
between each cell (field) in a row (record), and quotes
surrounding the contents of each field (e.g. 1,"Alpha",3).
Specified Delimiter Format asks for a delimiter X, and then
saves the file with each cell (field) in a row (record)
delimited by the symbol you entered (e.g. 1XAlphaX3).
Only Commas saves the file with commas between each cell
(field) in a row (record) (e.g. 1,alpha,beta,3,4).
The remaining three options provide a way to customize the
delimited output.
The Values Are Written As option lets you specify how you
want to save values. Numbers converts values to General
display format before saving them to the extracted file.
Labels retains cell formatting (Currency, Scientific, etc.)
but stores values as labels to ensure the data translates
properly, regardless of the cell's display format. Values
Are Written As is set to Numbers by default.
PRODUCT : QUATTRO PRO NUMBER : 532
VERSION : ALL
OS : PC DOS
DATE : April 18, 1991 PAGE : 7/6
TITLE : DELMAKER: DELIMITED OUTPUT MACRO
NOTE: If your data contains dates, set this option to
Labels. Otherwise, dates are saved as a julian serial
date number, which may be meaningless to some
applications.
The Empty Cells Are Written As option lets you specify how
DELMAKER should treat blank cells. Empty Labels will write
blank cells as blank labels. Zeros will write empty cells
as zero. Empty Cells Are Written As is set to Empty Labels
by default.
Quit exits the macro and returns you to the current
spreadsheet.